import { ref } from "vue";
import { defineStore } from "pinia";
import { fetchTaskDetailAPI } from "@/api/taskDetailApi";

const useTaskDetailStore = defineStore("taskDetailStore", () => {
  /*任务详情*/
  const taskDetail = ref({});

  /*获取任务详情的请求函数*/
  const fetchTaskDetail = async (jobId) => {
    const { data } = await fetchTaskDetailAPI(jobId);
    taskDetail.value = data;
  };

  return {
    taskDetail,
    fetchTaskDetail,
  };

});

export default useTaskDetailStore;
